/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("Fk_flow",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using VOL.MyTable.IServices;
using VOL.Core.Filters;
using VOL.Core.Enums;

namespace VOL.MyTable.Controllers
{
    public partial class Fk_flowController
    {
        private readonly IFk_flowService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public Fk_flowController(
            IFk_flowService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }

        [HttpPost, Route("GetPageData")]//重写权限
        [ApiActionPermission()]
        public override ActionResult GetPageData([FromBody] PageDataOptions loadData)
        {
            return base.GetPageData(loadData);
        }
        /// <summary>
        /// 新增操作（权限重写同上）
        /// </summary>
        /// <param name="saveModel"></param>
        /// <returns></returns>
        [ApiActionPermission()]
        [HttpPost, Route("Add")]
        public override ActionResult Add([FromBody] SaveModel saveModel)
        {
            return base.Add(saveModel);
        }
        /// <summary>
        ///编译操作（权限重写同上）
        /// </summary>
        /// <param name="saveModel"></param>
        /// <returns></returns>
        
        [HttpPost, Route("Update")]
        [ApiActionPermission()]
        public override ActionResult Update([FromBody] SaveModel saveModel)
        {
            return base.Update(saveModel);
        }
        /// <summary>
        /// 通过key删除文件（权限重写同上）
        /// </summary>
        /// <param name="keys"></param>
        /// <returns></returns>
        [ApiActionPermission()]
        [HttpPost, Route("Del")]
        public override ActionResult Del([FromBody] object[] keys)
        {
            return base.Del(keys);
        }
    }
}
